﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Wicture.DbRESTFul;
using Wicture.QPZS.EPC.API.Domain.Entities;
using Wicture.QPZS.EPC.API.InvokeContextBuilders.InvokeResultAnalysers;

namespace Wicture.QPZS.EPC.API.InvokeContextBuilders
{
    public class ResultDataThrottedBuilder : IThrottedContextBuilder
    {
        public decimal Order => 3;
        private readonly IInvokeResultAnalyserProxy _invokeResultAnalyserProxy;

        public ResultDataThrottedBuilder(IInvokeResultAnalyserProxy invokeResultAnalyserProxy)
        {
            _invokeResultAnalyserProxy = invokeResultAnalyserProxy;
        }

        public void Build(ThrottlingContext context, object sender, ApiInvokedArgs e)
        {
            _invokeResultAnalyserProxy.Analyse(context, e.Context);
        }
    }
}
